// 1.导入路由
import VueRouter from 'vue-router';

// 导入对应的路由组件
import HomeContainer from './components/tabbar/HomeContainer.vue';
import MemberContainer from './components/tabbar/MemberContainer.vue';
import SearchContainer from './components/tabbar/SearchContainer.vue';
import ShopcarContainer from './components/tabbar/ShopcarContainer.vue';


import NewList from './components/news/NewList.vue';
import NewInfo from './components/news/NewInfo.vue';
import ShareImg from './components/news/ShareImg.vue';
import Photoinfo from './components/news/Photoinfo.vue';
import BuyGoods from './components/news/BuyGoods,.vue';
import GoodsInfo from './components/news/goodsinfo.vue';
import PicInfo from './components/news/PicInfo.vue';
import InfoComponent from './components/news/InfoComponent.vue';
// 2.new 一个router实例
var router = new VueRouter({
    routes: [  //配置路由规则
        { path: '/', redirect: '/home' },
        { path: '/home', component: HomeContainer },
        { path: '/member', component: MemberContainer },
        { path: '/shopcar', component: ShopcarContainer },
        { path: '/search', component: SearchContainer },
        { path: '/home/newlist', component: NewList },
        { path: '/home/newsinfo/:id', component: NewInfo },  //匹配id
        { path: '/home/shareImg', component: ShareImg },
        { path: '/home/photoinfo/:id', component: Photoinfo },
        { path: '/home/buygoods', component: BuyGoods },
        { path: '/home/goodinfo/:id', name: 'goodinfo', component: GoodsInfo },
        { path: "/home/goodinfo/picinfo/:id", component: PicInfo },  //图文介绍
        { path: "/home/goodinfo/infocomponent/:id", component: InfoComponent}  //评论
    ],
    linkActiveClass: 'active'  //覆盖默认的路由高亮的类   routerlink-Active
})
// 3.暴露
export default router;